package cn.tedu.justone.pack03日期;

import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * ZZ：JustOne
 * VX：Andylau2020smile
 * DY：JustOne2018
 * ZT：《》
 */
public class Demo05_LocalDate得到LocalDateTime {
    public static void main(String[] args) {

        //根据LocalDate来创建LocalDateTime对象
        //根据LocalDate来创建LocalDateTime对象
        //根据LocalDate来创建LocalDateTime对象

        LocalDate localDate = LocalDate.parse("2000-01-01");

        //根据LocalDate来创建LocalDateTime对象

        //示例一：x.atStartOfDay();表示一天的开始时间
        LocalDateTime ldt1 = localDate.atStartOfDay();
        System.out.println(ldt1); //2000-01-01T00:00

        //示例二：.atTime(9,15);指定时、分
        LocalDateTime ldt2 = localDate.atTime(9,15);
        System.out.println(ldt2); //2000-01-01T09:15

        //示例三：.atTime(9,15);指定时、分、秒
        LocalDateTime ldt3 = localDate.atTime(11,12,35);
        System.out.println(ldt3); //2000-01-01T11:12:35

    }
}














